let rec join delim f x = 
	match x with 
		[] -> "" 
	  | hd::[] -> (f hd)
	  | hd::tl -> (f hd) ^ delim ^ (join delim f tl)



(*
let rec token_to_string tok = match tok with
	| EOF		-> "EOF"
	| ID x		-> (t2 "ID") x
	| NUMBER x	-> (t2 "NUMBER") x
	| EQ     	-> t1 "="
	| SEMI		-> t1 ";"
	| _	 		-> "<..>"
and
	t1 = fun x -> join ["'";  x; "'"]
and
	t2 = fun x y -> join [x; "("; y; ")"]
*)
